<%--
  Created by IntelliJ IDEA.
  User: RJXY
  Date: 2025/2/24
  Time: 11:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="static/jquery.js"></script>
<body>
<h1>第一节课</h1>

<form id="form" action="/test">
    用户：<input type="text" name="username"><br>
    密码：<input type="text" name="password"><br>
    <input type="submit">
<%--    <button onclick="submitData()">按钮</button>--%>
</form>
</body>

<script>
    function submitData() {
        var data = $("#form").serialize();
        $.ajax({
            type: "get",
            url: "/test",
            data: data,
            dataType: "json",
            success: function (res) {
                console.log(res)
            },
        })
    }
</script>
</html>
